﻿using System;

/*Write a program that compares two char arrays lexicographically (letter by letter).*/

   class ComparingLexicographically
    {
        static void Main()
        {
            int a = int.Parse(Console.ReadLine());
            char[] array1 = new char[a];

            int b = int.Parse(Console.ReadLine());
            char[] array2 = new char[b];

            if (a != b)
            {
                Console.WriteLine("Arrays are different!");
                return;
            }
            for (int i = 0; i < a; i++)
            {
                Console.Write("Write an element {0} for the first array:", i);
                array1[i] = Console.ReadKey().KeyChar;
                Console.WriteLine();

                Console.Write("Write an element {0} for the second array:", i);
                array2[i] = Console.ReadKey().KeyChar;
                Console.WriteLine();
            } 
            for (int i = 0; i < a; i++)
            {
                if (array1[i] != array2[i])
                {
                    Console.WriteLine("Arrays are different!");
                    return;
                }
            }
            Console.WriteLine("Arrays are equal!");
        }
        }
    

